package com.cqywc.cjadmin.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cqywc.cjadmin.service.ReturnSerivice;

@Controller
public class ExceptionController {
	
	@RequestMapping("/errorajax")
	@ResponseBody
	public ResponseEntity<ReturnSerivice>  ajax(HttpServletRequest request) {
		
		String msg=(String) request.getAttribute("msg");
		 ReturnSerivice returnSerivice =new ReturnSerivice(); 
		 returnSerivice.setCode(10001);
		 returnSerivice.setMsg(msg);
		return new ResponseEntity<ReturnSerivice>(returnSerivice, HttpStatus.NOT_ACCEPTABLE);
	}
	
}
